<?php 
require_once('../head/nav.php'); 
?>

    <div class="col-sm-9 col-md-10">

<form method=POST action="Admin.php?c=So&m=societysearch">
<table align="center" width="80%">
 <tr>
  <td><a href="admin.php?c=so&m=soform">添加社团活动信息</a></td>
  <td align="left"><h4>查找</h4></td>
  <td  align="left" >请输入活动名称：
    <input type="text" name="activity">
    <input type="submit" value="搜索"> 
  </td>
</tr>
</form> 

<h1 class="text-center">社团活动信息表</h1>
    <table class="table table-hover"> 
    <!-- 通过添加 .table-hover 类可以让 <tbody> 中的每一行对鼠标悬停状态作出响应。 -->
      <tr class="success">
        <th>活动编号</th>
        <th>活动名称</th>   
        <th>承办部门</th>
        <th>活动意义</th>
        <th>时间</th>
        <th>地点</th>
        <th width='80'>活动照片展示</th>
        <th>操作</th>
      </tr>
    </div>
  </div>
</div>

<?php
  //var_dump($data);
  static $count=0;
  if(array_key_exists('acid',$data['society'])){
    $count=1;
    $row = $data['society'];
    //var_dump($row);
    echo '<tr>';
    echo '<td>'.$row['acid'].'</td>';
    echo '<td>'.$row['activity'].'</td>';
    echo '<td>'.$row['dename'].'</td>';  
    echo '<td>'.$row['signifi'].'</td>';
    echo '<td>'.$row['time'].'</td>';
    echo '<td>'.$row['place'].'</td>';  
    echo '<td align="center"><img src='.UserPhotoPath.$row['acphoto'].' width=120 height=100 alt="无头像"></td>';
    echo '<td><a href="Admin.php?c=So&m=societyedit&id='.$row['acid'].' ">修改</a> | 
    <a href="Admin.php?c=So&m=delsociety&id='.$row['acid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
    echo '</tr>';
  }else{
    foreach ($data['society'] as $row)
    {
      $count++;
      echo '<tr>';
      echo '<td>'.$row['acid'].'</td>';
      echo '<td>'.$row['activity'].'</td>';
      echo '<td>'.$row['dename'].'</td>';  
      echo '<td>'.$row['signifi'].'</td>';
      echo '<td>'.$row['time'].'</td>';
      echo '<td>'.$row['place'].'</td>';  
      echo '<td align="center"><img src='.UserPhotoPath.$row['acphoto'].' width=120 height=100 alt="无头像"></td>';
      echo '<td><a href="Admin.php?c=So&m=societyedit&id='.$row['acid'].' ">修改</a> | 
      <a href="Admin.php?c=So&m=delsociety&id='.$row['acid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
      echo '</tr>';
    }
  }
  echo '</table>';  
  echo "<table align='center'><tr><td>共有{$count}个活动</td></tr></table>";   
?>

</div> 
<?php require_once('../head/footer.php'); ?>